<%-- 
    Document   : dealOfTheDay
    Created on : Jun 22, 2012, 10:33:11 AM
    Author     : Owner
--%>

<%@include file="/jsp/adminTop.jsp" %>

<html>
    <head>
        <title>Deal of The Day</title>       
    </head>
    <body>
        <div class="clear"></div>
        <table cellspacing="5px" width="100%" align="center">
            <tr>
                <td>
                    <table cellspacing="5px" width="100%" align="center">
                        <tr>
                            <td style="vertical-align: top;" width="20%">
                                <%@include file="/jsp/right.jsp" %></td>
                            <td>                &nbsp;            </td>
                            <td style="vertical-align: top;" width="80%">
                                <div class="page-title"><h1>Deal of The Day</h1></div>

                                <html:form action="/deal" method="post">
                                    <table cellspacing="10px" align="center" width="100%">
                                        <tr>
                                            <td>
                                                <html:select property="dealCategoryId" styleId="category" onchange="javascript:return getProductList(this);">
                                                    <html:option value="0">--Select Category--</html:option>
                                                    <html:options collection="subCategList" property="key" labelProperty="value"/>
                                                </html:select>
                                            </td>
                                            <td>

                                                <html:select property="dealProductId" styleId="product" onchange="javascript:return getProductDetail('./deal.do?action=getProductDetails','DealBean');">
                                                    <html:option value="0">--Select Product--</html:option>
                                                </html:select>

                                            </td>
                                        </tr>
                                        <%--
                                        <logic:present name="productDetail" scope="request">
                                            <bean:define name="deals" id="productList" property="prodBean"/>
                                            <tr >
                                                <td colspan="2">
                                                    <table cellspacing="10px" width="100%" align="center">
                                                        <tr>
                                                            <td colspan="2"><h3>Product Details</h3></td>
                                                        </tr>
                                                        <tr>
                                                            <td>Product Name:</td>
                                                            <td><bean:write name="" property=""/></td>
                                                        </tr>
                                                        <tr>
                                                            <td>Price:</td>
                                                            <td><bean:write name="" property=""/></td>
                                                        </tr>
                                                        <tr>
                                                            <td>Image:</td>
                                                            <td><img src="<bean:write name="" property=""/>" alt="" /></td>
                                                        </tr>
                                                        <tr>
                                                            <td colspan="2">
                                                                Deal of the Day Details
                                                            </td>
                                                        </tr>
                                                        <tr>
                                                            <td>  Deal Name:   </td>
                                                            <td>
                                                                <html:text property="dealName"/>
                                                            </td>
                                                        </tr>
                                                        <tr>
                                                            <td>  Start Date:   </td>
                                                            <td>
                                                                <html:text styleId="datepicker" property="startDate"/>
                                                            </td>
                                                        </tr>
                                                        <tr>
                                                            <td> Expiry Date:  </td>
                                                            <td>
                                                                <html:text styleId="datepicker" property="expiryDate"/>
                                                            </td>
                                                        </tr>
                                                        <tr>
                                                            <td> Deal Price: </td>
                                                            <td>
                                                                <html:text property="dealPrice"/>
                                                            </td>
                                                        </tr>
                                                        <tr>
                                                            <td>    Active:    </td>
                                                            <td>
                                                                <html:select property="dealStatusId">
                                                                    <html:option value="0">--Select--</html:option>
                                                                    <html:option value="1">Active</html:option>
                                                                    <html:option value="2">Inactive</html:option>
                                                                </html:select>
                                                            </td>
                                                        </tr>
                                                    </table>
                                                </td>
                                            </tr>
                                            <tr>
                                                <td colspan="2">
                                                    <a onclick="javascript:return dealoftheday('./deal.do?action=showEditDeal','DealBean')">
                                                        <img src="images/" alt="Save Deal" onmouseout="src='images/'" onmouseover="src='images/'"/>
                                                    </a>
                                                </td>
                                            </tr>
                                        </logic:present>
                                        --%>
                                    </table>
                                </html:form>
                                <table cellpadding="5px" cellspacing="10px" align="center" width="100%" border="1">
                                    <tr>
                                        <td><strong>Deal ID</strong></td>
                                        <td><strong>Deal Name</strong></td>
                                        <td><strong>Start Date</strong></td>
                                        <td><strong>Expiry Date</strong></td>
                                        <td><strong>Active</strong></td>
                                        <td><strong>Product </strong></td>
                                        <td><strong>Product Price</strong></td>
                                        <td><strong>New Price</strong></td>
                                        <td><strong>Edit / Delete</strong></td>
                                    </tr>
                                    <logic:notPresent name="dealList" scope="request">
                                        <logic:empty name="dealList" scope="request">
                                            <tr>
                                                <td colspan="9">
                                                    No Records found for Deals of the Day.
                                                </td>
                                            </tr>
                                        </logic:empty>
                                    </logic:notPresent>
                                    <logic:present name="dealList" scope="request">
                                        <logic:empty name="dealList" scope="request">

                                        </logic:empty>
                                        <logic:notEmpty name="dealList" scope="request">
                                            <logic:iterate name="dealList" id="deals" scope="request">
                                                <tr>
                                                    <td><bean:write name="deals" property="dealId"/></td>
                                                    <td><bean:write name="deals" property="dealName"/></td>
                                                    <td><bean:write name="deals" property="startDate"/></td>
                                                    <td><bean:write name="deals" property="expiryDate"/></td>
                                                    <td><bean:write name="deals" property="dealStatus"/></td>
                                                    <bean:define name="deals" id="product" property="prodBean"/>
                                                    <logic:present name="product" scope="request">
                                                        <td><bean:write name="product" property="productname"/></td>
                                                        <td><bean:write name="product" property="price"/></td>
                                                    </logic:present>
                                                    <td><bean:write name="deals" property="dealPrice"/></td>
                                                    <td>
                                                        <a href="./deal.do?action=showEditDeal&dealId=<bean:write name="deals" property="dealId"/>" >Edit</a> |
                                                        <a href="./deal.do?action=deleteDeal&dealId=<bean:write name="deals" property="dealId"/>" >Delete</a>
                                                    </td>
                                                </tr>
                                            </logic:iterate>
                                        </logic:notEmpty>
                                    </logic:present>
                                </table>
                            </td>                            
                        </tr>
                    </table>
                </td>
            </tr>
            <tr>
                <td><%@include file="/jsp/footer.jsp" %></td>
            </tr>
        </table>
    </body>
</html>
